﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WebProject.Controllers.Base
{
    public class BaseController : Controller
    {
        protected override void OnException(ExceptionContext filterContext)
        {
            //  throw filterContext.Exception;
            // filterContext.HttpContext.Response.Redirect("~/Account/Error");
          //  filterContext.ExceptionHandled = false;
          //  Response.Write("<script language =javascript >window.alert('" + filterContext.Exception + "');</script>");

            base.OnException(filterContext);
            //base.OnException(filterContext);
        }
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext.HttpContext.Session["user"] == null)
            {

                Response.Redirect("~/System/Login");
                return;
            }

        }
    }
}